﻿using ServiceCore;
using System;
using System.Collections.Generic;
using System.Text;

namespace Entity
{

    public enum question_order_state
    {

        待处理 = 0, 
        已完成 = 2,
    }
    public class question_order
    {
        /// <summary>
        /// 订单状态
        /// </summary>
        public question_order_state order_state { get; set; }
        /// <summary>
        /// 订单ID
        /// </summary>
        public string order_id { get; set; }
        /// <summary>
        /// 答题时间
        /// </summary>
        public DateTime add_time { get; set; }
        /// <summary>
        /// 答题人
        /// </summary>
        public string question_uid { get; set; }
        /// <summary>
        /// 员工编号
        /// </summary>
        public string work_num { get; set; }
        /// <summary>
        /// 员工姓名
        /// </summary>
        public string u_name { get; set; }
        /// <summary>
        /// 答题机器id
        /// </summary>
        public string mch_id { get; set; }
        /// <summary>
        /// 机器名称
        /// </summary>
        public string mch_name { get; set; }
        /// <summary>
        /// 机器SN
        /// </summary>
        public string mch_sn { get; set; }
        /// <summary>
        /// 答题商品
        /// </summary>
        public string product_id { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string product_name { get; set; }
        /// <summary>
        /// 商品图片
        /// </summary>
        public string product_pic { get; set; }
        /// <summary>
        /// 设置题目数量
        /// </summary>
        public int set_question_count { get; set; }
        /// <summary>
        /// 设置正确数量
        /// </summary>
        public int set_pass_count { get; set; }
        /// <summary>
        /// 策略ID
        /// </summary>
        public string strategy_id { get; set; }
        /// <summary>
        /// 答题是否通过
        /// </summary>
        public bool is_pass { get; set; }
        /// <summary>
        /// 出货货道
        /// </summary>
        public int out_slot { get; set; }
        /// <summary>
        /// 出货信息
        /// </summary>
        public string out_params { get; set; }
        /// <summary>
        /// 备注信息
        /// </summary>
        public string remark { get; set; }
        /// <summary>
        /// 所属用户
        /// </summary>
        public string baseuserid { get; set; }

        public bool is_end { get; set; }

        public int submit_pass_count { get; set; }
        /// <summary>
        /// 策略类型
        /// </summary>
        public question_strategy_type strategy_type { get; set; }
    }
    /// <summary>
    /// 答题记录
    /// </summary>
    public class question_order_record
    {
        /// <summary>
        ///  答题记录ID
        /// </summary>
        public string order_record_id { get; set; }
        /// <summary>
        /// 答题订单ID
        /// </summary>
        public string order_id { get; set; }
        /// <summary>
        /// 题目ID
        /// </summary>
        public string question_id { get; set; }
        /// <summary>
        /// 题干
        /// </summary>
        public string question_content { get; set; }
        /// <summary>
        /// 提交的答案
        /// </summary>
        public string sub_answer { get; set; }
        /// <summary>
        /// 设置的答案
        /// </summary>
        public string set_answer { get; set; }
        /// <summary>
        /// 是否正确
        /// </summary>
        public bool is_right { get; set; }
        /// <summary>
        /// 提交的答题顺序
        /// </summary>
        public int question_sort { get; set; }
        /// <summary>
        /// 正确答案内容
        /// </summary>
        public string answer_content { get; set; }
    }

    /// <summary>
    /// 提交答案
    /// </summary>
    public class submit_answer
    {
        /// <summary>
        /// 机器id
        /// </summary>
        public string mchid { get; set; }
        /// <summary>
        /// 使用策略id
        /// </summary>
        public string strategy_id { get; set; }
        /// <summary>
        /// 答题人id
        /// </summary>
        public string question_uid { get; set; }
        /// <summary>
        /// 提交答案
        /// </summary>
        public List<answer_item> answer_list { get; set; }
        /// <summary>
        /// 是否检测用户
        /// </summary>
        public bool need_check_user { get; set; } = true;
    }

    public class answer_item
    {
        public int question_index { get; set; }
        /// <summary>
        /// 题目ID
        /// </summary>
        public string question_id { get; set; }

        public int[] submit_answer { get; set; }
    }

    public class quertion_order_query : Base_List_Params
    {
        /// <summary>
        /// 搜索类型
        /// </summary>
        public user_search_type? searchtype { get; set; }
        /// <summary>
        /// 搜索项
        /// </summary>
        public string searchkey { get; set; }
        /// <summary>
        /// 答题机器
        /// </summary>
        public string mch_name { get; set; }
        /// <summary>
        /// 答题商品
        /// </summary>
        public string product_name { get; set; }
        /// <summary>
        /// 是否符合商品策略
        /// </summary>
        public bool? is_pass { get; set; }
        /// <summary>
        /// 搜索开始时间
        /// </summary>
        public string start_time { get; set; }
        /// <summary>
        /// 搜索结束时间
        /// </summary>
        public string end_time { get; set; }
    }

    public class quertion_order_search_item
    {
        /// <summary>
        ///   订单ID
        /// </summary>
        public string order_id { get; set; }
        /// <summary>
        /// 答题时间
        /// </summary>
        public DateTime add_time { get; set; }
        /// <summary>
        /// 员工编号
        /// </summary>
        public string work_num { get; set; }
        /// <summary>
        /// 员工姓名
        /// </summary>
        public string u_name { get; set; }
        /// <summary>
        /// 答题机器
        /// </summary>
        public string mch_name { get; set; }
        /// <summary>
        /// 答题商品
        /// </summary>
        public string product_name { get; set; }
        /// <summary>
        /// 题目数量
        /// </summary>
        public int set_question_count { get; set; }
        /// <summary>
        /// 设置正确数量
        /// </summary>
        public int set_pass_count { get; set; }
        /// <summary>
        /// 实际答题正确数
        /// </summary>
        public int submit_pass_count { get; set; }
        /// <summary>
        /// 答题结果
        /// </summary>
        public bool is_pass { get; set; }
        /// <summary>
        /// 出货货道
        /// </summary>
        public int out_slot { get; set; }
        /// <summary>
        /// 出货情况
        /// </summary>
        public string out_params { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string remark { get; set; }

        /// <summary>
        /// 订单处理情况
        /// </summary>
        public int order_state { get; set; }
    }
}
